# -*- coding: utf-8 -*-
import scrapy


class S01Spider(scrapy.Spider):
    name = 's01'
    allowed_domains = ['https://edu.csdn.net/']
    # start_urls = ['http://https://edu.csdn.net//']
    #
    # def parse(self, response):
    #     print('*'*40)
    #     print(response.body)
    #     print('*' * 40)
    def start_requests(self):
        yield scrapy.Request(
            url='http://edu.csdn.net/',
            callback=self.parse,
        )

    def parse(self, response):
        # print('*' * 40)
        # print(response.body)
        # print('*' * 40)
        # print('*' * 40)
        # print(response.xpath('//div[@class="classify_cList"]//a/text()').extract())
        data = response.xpath('//div[@class="classify_cList"]//a/text()').extract()
        item = {}
        item['data'] = data
        print('要去settings里面设置ITEM_PIPELINES')
        yield item

